//
//  SelectButton.m
//  tour
//
//  Created by 123 on 16/4/1.
//  Copyright © 2016年 Jushi. All rights reserved.
//

#import "SelectButton.h"

@implementation SelectButton


- (void)setSelected:(BOOL)selected
{
    [super setSelected:selected];
    if (selected) {
        [UIView animateWithDuration:0.25 animations:^{
            self.imageView.transform = CGAffineTransformMakeRotation(M_PI-0.01);
        }];
    }else{
        [UIView animateWithDuration:0.25 animations:^{
            self.imageView.transform = CGAffineTransformIdentity;
        }];
    }
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    self.imageView.width = 17;
    self.imageView.height = 15;
    self.imageView.y = (self.height - self.imageView.height)/2.0;
    self.titleLabel.x = (self.width-self.imageView.width-self.titleLabel.width)/2;
    self.imageView.x = CGRectGetMaxX(self.titleLabel.frame);
}

@end
